package com.bus.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bus.entity.Products;
import com.bus.mapper.ProductMapper;
import com.bus.util.Page;

@Service("productService")
public class ProductServiceImp implements ProductService {
	@Autowired
	private ProductMapper pm;

	@Override
	public List<Products> findAllProductByPageCondition(Products p) {
		return pm.selectAllProductByPageCondition(p);
	}

	@Override
	public List<Products> findAllProducts(Products p) {
		return pm.selectAllProducts2(p);
	}

	@Override
	public Products findProductById(Integer id) {
		return pm.selectProductById(id);
	}

	@Override
	public int modifyProductById(Products product) {
		return pm.updateProductById(product);
	}

	@Override
	public int addProduct(Products p) {
		return pm.insertProduct(p);
	}

	@Override
	public int removeProductByid(Integer id) {
		return pm.deleteProductByid(id);
	}
}
